import type { NodeTypes } from '@xyflow/react'
import { useMemo } from 'react'
import { PositionLoggerNode } from './nodeList/PositionLoggerNode'
import Cnode from './nodeList/Cnode'
import { AppNode } from './types'

export const initialNodes: AppNode[] = [
  { id: 'a', type: 'input', position: { x: 0, y: 0 }, data: { label: 'wire' } },
  {
    id: 'b',
    type: 'position-logger',
    position: { x: -100, y: 100 },
    data: { label: 'drag me!' }
  }
]
//节点组件种类映射表 可单独写组件通过数组映射
export const nodeTypes = {
  'position-logger': PositionLoggerNode,
  cNode: Cnode
  // Add any of your custom nodes here!
} satisfies NodeTypes
